﻿//$.includeFile(['/Styles/lib/jquery-ui/jquery-ui-1.8.22.custom.css', '/scripts/ui/jquery/jquery.ui.core.js', '/Scripts/UI/Jquery/jquery.ui.widget.min.js', '/Scripts/UI/Jquery/jquery.ui.mouse.min.js', '/scripts/ui/jquery/jquery.ui.draggable.min.js', '/Scripts/UI/Jquery/jquery.ui.position.min.js', '/Scripts/UI/Jquery/jquery.ui.dialog.js']);
var DialogMessage = {
    Init: function dialogMessage(title, msg) {
        var dialogObj = $('<div title="' + title + '"><p><span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>' + msg + '</p></div>');
        return dialogObj;
    },
    Show: function dilaogMessage(status, msg, fn) { /*弹出message信息框 status=0错误,1成功，2警告*/

        //var dialogObj = $('<div id="dialog-message" title="Success"><span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span><div>111</div></div>');
        //dialogObj.find("div").html(msg);
        var dialogObj;
        if (status == 0) {
            dialogObj = DialogMessage.Init("错误", msg);
        } else if (status == 1) {

            dialogObj = DialogMessage.Init("成功", msg);
        } else if (status == 2) {
            dialogObj = DialogMessage.Init("警告", msg);
        }

        dialogObj.dialog({
            resizable: false,
            modal: true,
            zIndex: 99999,
            buttons: {
                "确定": function () {
                    if (fn != undefined) {
                        fn();
                    }
                    $(this).dialog("close");
                }
            }
        });
    },
    ConfirmShow: function (title, msg, callback) {
        DialogMessage.Init(title, msg).dialog({
            resizable: false,
            width: 300,
            height: 140,
            zIndex: 3999,
            modal: true,
            buttons: {
                "确定": function () {
                    if (callback != undefined) {
                        callback();
                    }
                    $(this).dialog("close");
                },
                "取消": function () {
                    $(this).dialog("close");
                }
            }
        });
    }
}